home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / AIncludes / PPCToolbox.a < prev    next >
Encoding:
Text File  |  1992-01-29  |  11.9 KB  |  401 lines  |  [TEXT/MPS ]

  1. ; Version: 1.00
  2. ; Created: Friday, October 20, 1989 at 9:35:53 PM
  3. ;
  4. ;      PPCToolbox.a
  5. ;      Assembler Interface to the Macintosh Libraries
  6. ;
  7. ;      Copyright Apple Computer, Inc.  1989-1991
  8. ;      All rights reserved
  9. ;
  10.  
  11.     IF &TYPE('__IncludingPPCToolbox__') = 'UNDEFINED' THEN
  12. __IncludingPPCToolbox__    SET    1
  13.  
  14.     IF &TYPE('__IncludingTraps__') = 'UNDEFINED' THEN       ; get defintion of _Pack9
  15.     INCLUDE 'Traps.a'
  16.     ENDIF
  17.  
  18. ;  PPCCommand Values
  19.  
  20. ;    Trap Selector D0 Must be set to one of the following, csCode will contain this value
  21. ;    when the call completes.
  22.  
  23. ppcInitCmd            EQU            0
  24. ppcOpenCmd            EQU         1
  25. ppcStartCmd           EQU         2
  26. ppcInformCmd          EQU         3
  27. ppcAcceptCmd          EQU         4
  28. ppcRejectCmd          EQU         5
  29. ppcWriteCmd           EQU         6
  30. ppcReadCmd            EQU         7
  31. ppcEndCmd             EQU         8
  32. ppcCloseCmd           EQU         9
  33. IPCListPortsCmd        EQU         10
  34. ppcKillCmd            EQU            11
  35.  
  36. DeleteUserCmd        EQU         12
  37. GetDefaultUserCmd    EQU         13
  38. StartSecureCmd        EQU         14
  39.  
  40. ;    Valid PPCServiceTypes
  41. ppcServiceRealTime    EQU            1
  42. ppcServiceStoreAndForward     EQU 2
  43.  
  44.  
  45. ;    Valid PPCLocationKinds    =    Integer;
  46. ppcNoLocation        EQU            0 ;    There is no PPCLocName
  47. ppcNBPLocation        EQU            1 ;    Use AppleTalk NBP
  48. ppcNBPTypeLocation    EQU            2 ;    Use just the NBP type, fill in rest with default
  49.  
  50. ;    Valid PPCPortKinds        =    Integer;
  51. ppcByCreatorAndType    EQU            1 ;    Port type is specified as colloquial Mac creator and type
  52. ppcByString         EQU            2 ;    Port type is in pascal string format
  53.  
  54. ;    Valid PPCSessionOrigins    =    SignedByte;    { requestType returned in PPCInform }
  55. ppcLocalOrigin        EQU            1 ;    session originated from this machine
  56. ppcRemoteOrigin        EQU            2 ;    session originated from remote machine
  57.  
  58. PPCPortRec            RECORD    0 ;        TYPE                Comment
  59. nameScript            DS.W    1 ;        ScriptCode;            script of name
  60. name                DS.B    34 ;        Str32;                name of port as seen in browser
  61. portKindSelector    DS.W    1 ;        PPCPortKinds;        which variant
  62. portTypeStr            DS.B    34 ;        Str32;
  63.                     ORG portTypeStr
  64. portCreator            DS.L    1 ;        OSType;
  65. portType            DS.L    1 ;        OSType;
  66.                     ENDR
  67.  
  68. LocationNameRec    RECORD        0 ;
  69. locationKindSelector    DS.W    1 ;    PPCLocationKind;    which variant
  70. nbpEntity                DS.B     100 ;                    NBP name entity
  71.                         ORG nbpEntity ;
  72. nbpType                    DS.B    34 ;    Str32;                just the NBP type string, for PPCOpen
  73.                         ENDR
  74.  
  75.  
  76. PortInfoRec            RECORD    0 ;
  77. filler1                DS.B    1 ;    SignedByte;
  78. authRequired        DS.B    1 ;    Boolean;
  79. name                DS PPCPortRec ;
  80.                     ENDR
  81.                     
  82.                     
  83. PPCOpenPBRec     RECORD    0 ;        TYPE                Comment
  84. qLink            DS.L    1 ;        Ptr                    reserved
  85. csCode            DS.W    1 ;        INTEGER                reserved
  86. intUse            DS.W    1 ;        INTEGER                reserved
  87. intUsePtr        DS.L    1 ;        Ptr                    reserved
  88. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  89. ioResult        DS.W    1 ;        OSErr                Result of operation.
  90. reserved        DS.L    5 ;        LONGINT                reserved
  91. portRefNum        DS.W    1 ;        PPCPortRefNum        Port Reference            
  92. filler1            DS.L    1 ;        LONGINT                ignored            
  93. serviceType        DS.B    1 ;         PPCServiceType        Bit field describing the requested port service
  94. resFlag            DS.B    1 ;        BYTE                Must be set to 0
  95. portName        DS.L    1 ;        PPCPortPtr            PortName for PPC
  96. locationName    DS.L    1 ;        LocationNamePtr        If NBP  Registration is required
  97. networkVisible    DS.B    1 ;         BOOLEAN                make this network visible on network
  98. nbpRegistered    DS.B    1 ;         BOOLEAN                The given location name was registered on the network
  99.                 ENDR
  100.  
  101.  
  102. PPCInformPBRec    RECORD    0 ;        TYPE                Comment
  103. qLink            DS.L    1 ;        Ptr                    reserved
  104. csCode            DS.W    1 ;        INTEGER                reserved
  105. intUse            DS.W    1 ;        INTEGER                reserved
  106. intUsePtr        DS.L    1 ;        Ptr                    reserved
  107. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  108. ioResult        DS.W    1 ;        OSErr                Result of operation.
  109. reserved        DS.L    5 ;        LONGINT                reserved
  110. portRefNum         DS.W    1 ;        PPCPortRefNum        Port Identifier
  111. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  112. serviceType        DS.B    1 ;        PPCServiceType        Status Flags for type of session, local, remote
  113. autoAccept         DS.B    1 ;        Boolean                if true session will be accepted automatically
  114. portName        DS.L    1 ;        PPCPortPtr            Buffer for Source PPCPortRec
  115. locationName    DS.L    1 ;        LocationNamePtr        Buffer for Source LocationNameRec
  116. userName        DS.L    1 ;        StringPtr            Buffer for Soure user's name trying to link.
  117. userData        DS.L    1 ;        LongInt                value included in PPCStart's userData
  118. requestType        DS.B    1 ;        PPCSessionOrigin    Local or Network
  119.                 ENDR
  120.  
  121.  
  122. PPCStartPBRec    RECORD    0 ;        TYPE                Comment
  123. qLink            DS.L    1 ;        Ptr                    reserved
  124. csCode            DS.W    1 ;        INTEGER                reserved
  125. intUse            DS.W    1 ;        INTEGER                reserved
  126. intUsePtr        DS.L    1 ;        Ptr                    reserved
  127. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  128. ioResult        DS.W    1 ;        OSErr                Result of operation.
  129. reserved        DS.L    5 ;        LONGINT                reserved
  130. portRefNum:     DS.W    1 ;        PPCPortRefNum;        Port Identifier
  131. sessRefNum:        DS.L    1 ;        PPCSessRefNum;        Session Reference
  132. serviceType:    DS.B    1 ;        PPCServiceType        Actual service method (realTime)
  133. resFlag:         DS.B    1 ;        SignedByte            Must be set to 0
  134. portName:        DS.L    1 ;        PPCPortPtr            Destination portName
  135. locationName:    DS.L    1 ;        LocationNamePtr        NBP or NAS style service location name
  136. rejectInfo:        DS.L    1 ;        LongInt                reason for rejecting the session request
  137. userData:        DS.L    1 ;        LongInt                Copied to destination PPCInform parameter block
  138. userRefNum:        DS.L    1 ;        LongInt                userRefNum (obtained during login process)
  139.                 ENDR
  140.  
  141.  
  142. PPCAcceptPBRec    RECORD    0 ;        TYPE                Comment
  143. qLink            DS.L    1 ;        Ptr                    reserved
  144. csCode            DS.W    1 ;        INTEGER                reserved
  145. intUse            DS.W    1 ;        INTEGER                reserved
  146. intUsePtr        DS.L    1 ;        Ptr                    reserved
  147. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  148. ioResult        DS.W    1 ;        OSErr                Result of operation.
  149. reserved        DS.L    5 ;        LONGINT                reserved
  150. filler1            DS.W    1 ;         Integer                    
  151. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  152.                 ENDR
  153.                         
  154.                         
  155. PPCRejectPBRec    RECORD    0 ;        TYPE                Comment
  156. qLink            DS.L    1 ;        Ptr                    reserved
  157. csCode            DS.W    1 ;        INTEGER                reserved
  158. intUse            DS.W    1 ;        INTEGER                reserved
  159. intUsePtr        DS.L    1 ;        Ptr                    reserved
  160. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  161. ioResult        DS.W    1 ;        OSErr                Result of operation.
  162. reserved        DS.L    5 ;        LONGINT                reserved
  163. filler1            DS.W    1 ;         Integer
  164. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  165. filler2            DS.W    1 ;        Integer
  166. filler3            DS.L    1 ;        LongInt
  167. filler4            DS.L    1 ;        LongInt
  168. rejectInfo        DS.L    1 ;        LongInt                reason for rejecting the session request
  169.                 ENDR
  170.     
  171.     
  172. PPCWritePBRec    RECORD    0 ;        TYPE                Comment
  173. qLink            DS.L    1 ;        Ptr                    reserved
  174. csCode            DS.W    1 ;        INTEGER                reserved
  175. intUse            DS.W    1 ;        INTEGER                reserved
  176. intUsePtr        DS.L    1 ;        Ptr                    reserved
  177. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  178. ioResult        DS.W    1 ;        OSErr                Result of operation.
  179. reserved        DS.L    5 ;        LONGINT                reserved
  180. filler1            DS.W    1 ;        Integer
  181. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  182. bufferLength    DS.L    1 ;        Size                Length of the message buffer
  183. actualLength    DS.L    1 ;        Size                Actual Length Written
  184. bufferPtr        DS.L    1 ;        Ptr                    Pointer to message buffer
  185. more            DS.B    1 ;        Boolean                if more data in this block will be written    
  186. filler2            DS.B    1 ;        SignedByte;                 
  187. userData        DS.L    1 ;        LongInt                Message block userData Uninterpreted by PPC    
  188. blockCreator    DS.L    1 ;        OSType                Message block creator Uninterpreted by PPC    
  189. blockType        DS.L    1 ;        OSType                Message block type Uninterpreted by PPC    
  190.                 ENDR
  191.     
  192.     
  193. PPCReadPBRec    RECORD    0 ;        TYPE                Comment
  194. qLink            DS.L    1 ;        Ptr                    reserved
  195. csCode            DS.W    1 ;        INTEGER                reserved
  196. intUse            DS.W    1 ;        INTEGER                reserved
  197. intUsePtr        DS.L    1 ;        Ptr                    reserved
  198. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  199. ioResult        DS.W    1 ;        OSErr                Result of operation.
  200. reserved        DS.L    5 ;        LONGINT                reserved
  201. filler1            DS.W    1 ;        Integer
  202. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  203. bufferLength    DS.L    1 ;        Size                Length of the message buffer
  204. actualLength    DS.L    1 ;        Size                Actual length read
  205. bufferPtr        DS.L    1 ;        Ptr                    Pointer to message buffer
  206. more            DS.B    1 ;        Boolean                if true more data in this block to be read
  207. filler2            DS.B    1 ;        SignedByte
  208. userData        DS.L    1 ;        LongInt                Message block userData Uninterpreted by PPC
  209. blockCreator    DS.L    1 ;        OSType                Message block creator Uninterpreted by PPC
  210. blockType        DS.L    1 ;        OSType                Message block type Uninterpreted by PPC
  211.                 ENDR
  212.     
  213.     
  214. PPCEndPBRec        RECORD    0 ;        TYPE                Comment
  215. qLink            DS.L    1 ;        Ptr                    reserved
  216. csCode            DS.W    1 ;        INTEGER                reserved
  217. intUse            DS.W    1 ;        INTEGER                reserved
  218. intUsePtr        DS.L    1 ;        Ptr                    reserved
  219. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  220. ioResult        DS.W    1 ;        OSErr                Result of operation.
  221. reserved        DS.L    5 ;        LONGINT                reserved
  222. filler1            DS.W    1 ;        Integer                    
  223. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  224.                 ENDR
  225.     
  226.     
  227. PPCClosePBRec    RECORD    0 ;        TYPE                Comment
  228. qLink            DS.L    1 ;        Ptr                    reserved
  229. csCode            DS.W    1 ;        INTEGER                reserved
  230. intUse            DS.W    1 ;        INTEGER                reserved
  231. intUsePtr        DS.L    1 ;        Ptr                    reserved
  232. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  233. ioResult        DS.W    1 ;        OSErr                Result of operation.
  234. reserved        DS.L    5 ;        LONGINT                reserved
  235. portRefNum        DS.W    1 ;         PPCPortRefNum        Port Identifier
  236.                 ENDR
  237.     
  238.     
  239. IPCListPortsPBRec    RECORD    0 ;    TYPE                Comment
  240. qLink            DS.L    1 ;        Ptr                    reserved
  241. csCode            DS.W    1 ;        INTEGER                reserved
  242. intUse            DS.W    1 ;        INTEGER                reserved
  243. intUsePtr        DS.L    1 ;        Ptr                    reserved
  244. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  245. ioResult        DS.W    1 ;        OSErr                Result of operation.
  246. reserved        DS.L    5 ;        LONGINT                reserved
  247. filler1            DS.W    1 ;        Integer
  248. startIndex        DS.W    1 ;         Integer                Start Index
  249. requestCount    DS.W    1 ;        Integer                Number of entries to be returned
  250. actualCount        DS.W    1 ;        Integer                Actual Number of entries to be returned
  251. portName        DS.L    1 ;        PPCPortPtr            PortName Match
  252. locationName    DS.L    1 ;        LocationNamePtr        NBP or NAS type name to locate the Port Location
  253. bufferPtr        DS.L    1 ;        PortInfoArrayPtr    Pointer to a buffer requestCount*sizeof(PortInfo) bytes big                            
  254.                 ENDR
  255.     
  256. DeleteUserParams    RECORD     0 ;
  257. userRefNum        DS.L    1 ;        LONGINT
  258.                 ENDR
  259.  
  260. StartSecureParams    RECORD    0 ;    TYPE
  261. prompt            DS.L    1 ;        StringPtr
  262. guestSelected    DS.L    1 ;        pointer to a Boolean
  263. allowGuest        DS.B    1 ;        Boolean
  264. reserved1        DS.B    1 ;        Byte
  265. useDefault        DS.B    1 ;        Boolean
  266. reserved2        DS.B    1 ;        Byte
  267. userName        DS.L    1 ;        StringPtr
  268. startPb            DS.L    1 ;        PPCStartPBPtr
  269.                 ENDR
  270.  
  271. GetDefaultUserParams    RECORD    0 ;
  272. userName        DS.L    1 ;        Pointer to Str32.
  273. userRef            DS.L    1 ;        Pointer to LONGINT.
  274.                 ENDR
  275.  
  276. PPCParamBlockRec    RECORD    0 ;
  277. openParam        DS    PPCOpenPBRec
  278.                 ORG 0
  279. informParam        DS    PPCInformPBRec
  280.                 ORG 0
  281. startParam        DS    PPCStartPBRec
  282.                 ORG 0
  283. acceptParam        DS    PPCAcceptPBRec
  284.                 ORG 0
  285. rejectParam        DS    PPCRejectPBRec
  286.                 ORG 0
  287. writeParam        DS    PPCWritePBRec
  288.                 ORG 0
  289. readParam         DS    PPCReadPBRec
  290.                 ORG 0
  291. endParam        DS    PPCEndPBRec
  292.                 ORG 0
  293. closeParam        DS    PPCClosePBRec
  294.                 ORG 0
  295. listPortsParam    DS    IPCListPortsPBRec
  296.                 ENDR
  297.  
  298.  
  299.  
  300.                   Macro
  301.                   _PPCInit
  302.                   MOVEQ       #ppcInitCmd,D0
  303.                   DC.W        $A0DD
  304.                   Endm
  305.  
  306.                   Macro
  307.                   _DoPPCTrap
  308.                   IF          &SYSLIST[1] = 'SYNC' THEN
  309.                   DC.W        $A0DD
  310.                   ELSE
  311.                   DC.W        $A4DD
  312.                   ENDIF
  313.                   Endm
  314.  
  315.                   Macro
  316.                   _PPCMacro
  317.                   MOVEQ       &SYSLIST[1],D0
  318.                   _DoPPCTrap &SYSLIST[2] 
  319.                   Endm
  320.  
  321.                   Macro
  322.                   _PPCOpen
  323.                   _PPCMacro   #ppcOpenCmd,&SYSLIST[2]
  324.                   Endm
  325.  
  326.                   Macro
  327.                   _PPCInform
  328.                   _PPCMacro   #ppcInformCmd,&SYSLIST[2]
  329.                   Endm
  330.  
  331.                   Macro
  332.                   _PPCStart
  333.                   _PPCMacro   #ppcStartCmd,&SYSLIST[2]
  334.                   Endm
  335.  
  336.                   Macro
  337.                   _PPCAccept
  338.                   _PPCMacro   #ppcAcceptCmd,&SYSLIST[2]
  339.                   Endm
  340.  
  341.                   Macro
  342.                   _PPCReject
  343.                   _PPCMacro   #ppcRejectCmd,&SYSLIST[2]
  344.                   Endm
  345.  
  346.                   Macro
  347.                   _PPCWrite
  348.                   _PPCMacro   #ppcWriteCmd,&SYSLIST[2]
  349.                   Endm
  350.  
  351.                   Macro
  352.                   _PPCRead
  353.                   _PPCMacro   #ppcReadCmd,&SYSLIST[2]
  354.                   Endm
  355.  
  356.                   Macro
  357.                   _PPCClose
  358.                   _PPCMacro   #ppcCloseCmd,&SYSLIST[2]
  359.                   Endm
  360.  
  361.                   Macro
  362.                   _PPCEnd
  363.                   _PPCMacro   #ppcEndCmd,&SYSLIST[2]
  364.                   Endm
  365.  
  366.                   Macro
  367.                   _IPCListPorts
  368.                   _PPCMacro   #IPCListPortsCmd,&SYSLIST[2]
  369.                   Endm
  370.                 
  371.                 Macro
  372.                 _PPCKill
  373.                 Moveq   #ppcKillCmd,D0    
  374.                 DC.W    $A0DD
  375.                 Endm
  376.  
  377.                 Macro
  378.                 _DeleteUserIdentity
  379.                 Moveq    #DeleteUserCmd,D0
  380.                 DC.W    $A0DD
  381.                 Endm
  382.                 
  383.                 Macro
  384.                 _GetDefaultUser
  385.                 Moveq    #GetDefaultUserCmd,D0
  386.                 DC.W    $A0DD
  387.                 Endm
  388.  
  389.                 Macro
  390.                 _StartSecureSession
  391.                 Moveq    #StartSecureCmd,D0
  392.                 DC.W    $A0DD
  393.                 Endm
  394.  
  395.                 Macro
  396.                 _PPCBrowser
  397.                 MOVE.W        #$0D00,D0
  398.                 _Pack9
  399.                   Endm
  400.  
  401.     ENDIF     ;...already included